﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;

using PCC.Framework.Data;
using PCC.Framework.Model;

namespace PCC.Framework.Biz
{
    public class ArchiveBiz
    {
        private ArchiveData _archiveData;

        public ArchiveBiz()
        {
            _archiveData = new ArchiveData();
        }

        public List<DocumentArchiveEntity> QueryDocsByArchiveType(int type, PageInfo pageInfo, SortBy sort)
        {
            DataTable documentTable = _archiveData.QueryDocsByArchiveType(type, pageInfo, sort);
            List<DocumentArchiveEntity> tempList = new List<DocumentArchiveEntity>();
            if (null != documentTable && documentTable.Rows.Count > 0)
            {
                foreach (DataRow row in documentTable.Rows)
                {
                    tempList.Add(new DocumentArchiveEntity
                    {
                        DataId = row["dataid"].ToString(),
                        ArchiveNum = row["archivenum"].ToString(),
                        ArchiveSource = row["archivesource"].ToString(),
                        FullFondsNum = row["fullfondsnum"].ToString(),
                        TempOrderNum = row["tempordernum"].ToString(),
                        Title = row["title"].ToString()
                    });
                }
            }
            return tempList;
        }

        public DataTable QueryWellCatalogByParentId(string parentId)
        {
            return _archiveData.QueryWellCatalogByParentId(parentId);
        }

        
    }
}
